<?php
/**
 *
 * @author andrew carlson <andrew@acstudiosllc.com>
 * @version 0.0.1
 * @copyright 2012 AcStudios LLC
 * @package default
 */

namespace Encompass\Settings;
USE PDO;

/**
 * class account functions
 * 
 * pulled example code in to see if I can get this working
 *
 * @package default
 * @author  andrew carlson <andrew@acstudiosllc.com>
 */
class settingsController extends \Encompass\Core\coreController {

	function __construct() {
		$loader = new \Twig_Loader_Filesystem('templates/');
		$action = \Encompass\Utilities\utilities::actionRoute();

		if (CACHING) {
			$twig = new \Twig_Environment($loader, array('cache' => 'tmp/cache'));
		} else {
			$twig = new \Twig_Environment($loader);
		}

		$template = $twig->loadTemplate('settings.tpl');
		$this->$action();

		// this needs to be moved, but we can't see anything w/o it
		$template->display(array(
			'pageTitle' => 'Encompass Settings',
		));

	}
	
	/** 
	 * define, display, and save base platform settings
	 */
	function base_settings() {
		$model = new \Encompass\Settings\settingsModel;
		$settings = $model->baseSettings();
		echo json_encode($settings);
		exit;
	}
	
	function projects_settings() {
		echo "Projects Settings";
	}
	
	function tickets_settings() {
		echo "Tickets Settings";
	}
	
	function wiki_settings() {
		echo "Knowledge Base Settings";
	}
	
	/**
	 * scan system and get settings from each function
	 * and display/save those settings
	 */
	function moduleSettings() {
		
	}
	
	function grid() {
	}
}
